import { request } from '@/utils/request.js'

/**
 * 供应商账单 API JS
 */

export default {

  /**
   * 获取供应商账单分页列表
   * @returns
   */
  getList (params = {}) {
    return request({
      url: 'finance/suppliersBill/index',
      method: 'get',
      params
    })
  },

  /**
   * 添加供应商账单
   * @returns
   */
  save (data = {}) {
    return request({
      url: 'finance/suppliersBill/save',
      method: 'post',
      data
    })
  },

  /**
   * 更新供应商账单数据
   * @returns
   */
  update (id, data = {}) {
    return request({
      url: 'finance/suppliersBill/update/' + id,
      method: 'put',
      data
    })
  },
  getFeeList (params = {}) {
    return request({
      url: 'finance/supplierFee/feeList',
      method: 'get',
      params
    })
  },
    /**
   * 获取核销记录
   * @returns
   */
    getStateList (data = {}) {
      return request({
        url: 'finance/statementFee/remote',
        method: 'post',
        data
      })
    },

  /**
   * 读取供应商账单
   * @returns
   */
  read (id,data={}) {
    return request({
      url: 'finance/suppliersBill/read/' + id,
      method: 'get',
      data
    })
  },

  /**
   * 将供应商账单删除，有软删除则移动到回收站
   * @returns
   */
  deletes (data) {
    return request({
      url: 'finance/suppliersBill/delete',
      method: 'delete',
      data
    })
  },

  /**
   * 从回收站获取供应商账单数据列表
   * @returns
   */
  getRecycleList (params = {}) {
    return request({
      url: 'finance/suppliersBill/recycle',
      method: 'get',
      params
    })
  },

  /**
   * 恢复供应商账单数据
   * @returns
   */
  recoverys (data) {
    return request({
      url: 'finance/suppliersBill/recovery',
      method: 'put',
      data
    })
  },

  /**
   * 真实删除供应商账单
   * @returns
   */
  realDeletes (data) {
    return request({
      url: 'finance/suppliersBill/realDelete',
      method: 'delete',
      data
    })
  },

  /**
   * 供应商账单导出
   * @returns
   */
  exportExcel (params = {}) {
    return request({
      url: 'finance/suppliersBill/export',
      method: 'post',
      responseType: 'blob',
      params
    })
  },
  /**
   * 审计
   * @returns
   */
  auditPass (data = {}) {
    return request({
      url: 'finance/suppliersBill/audit/pass',
      method: 'post',
      data
    })
  },
  /**
   * 反审计
   * @returns
   */
  auditRefuse (data = {}) {
    return request({
      url: 'finance/suppliersBill/audit/refuse',
      method: 'post',
      data
    })
  },
    /**
     * 反核销
     * @returns
     */
    writeOffRefuse (data = {}) {
      return request({
        url: 'finance/suppliersBill/writeOff/refuse',
        method: 'post',
        data
      })
    },
    /**
     * 核销
     * @returns
     */
    writeOffPass (data = {}) {
      return request({
        url: 'finance/suppliersBill/writeOff/pass',
        method: 'post',
        data
      })
    },

}